package cn.edu.nju.software.sellerSystem;


/**
* cn/edu/nju/software/sellerSystem/SystemBPOA.java .
* �� IDL-to-Java ������������ֲ�����汾 "3.2" ���
* ���� sellerB.idl
* 2009��4��7�� ���ڶ� ����09ʱ32��35�� CST
*/

public abstract class SystemBPOA extends org.omg.PortableServer.Servant
 implements cn.edu.nju.software.sellerSystem.SystemBOperations, org.omg.CORBA.portable.InvokeHandler
{

  // Constructors

  private static java.util.Hashtable _methods = new java.util.Hashtable ();
  static
  {
    _methods.put ("sentPurchaseExpection", new java.lang.Integer (0));
    _methods.put ("requestPurchase", new java.lang.Integer (1));
    _methods.put ("ackPurchase", new java.lang.Integer (2));
    _methods.put ("askToDeliver", new java.lang.Integer (3));
    _methods.put ("notifyDealDone", new java.lang.Integer (4));
    _methods.put ("affirm", new java.lang.Integer (5));
  }

  public org.omg.CORBA.portable.OutputStream _invoke (String $method,
                                org.omg.CORBA.portable.InputStream in,
                                org.omg.CORBA.portable.ResponseHandler $rh)
  {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
    if (__method == null)
      throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue ())
    {

  /*
  		��\
  		?��?-��?z??-1?2
  			
  		?p
  			type F?{? 
  			expectedPrice  ��<
  		
  		?��
  			F?��o
  		*/
       case 0:  // sellerSystem/SystemB/sentPurchaseExpection
       {
         String type = in.read_string ();
         double expectedPrice = in.read_double ();
         cn.edu.nju.software.sellerSystem.ProductInfo $result = null;
         $result = this.sentPurchaseExpection (type, expectedPrice);
         out = $rh.createReply();
         cn.edu.nju.software.sellerSystem.ProductInfoHelper.write (out, $result);
         break;
       }


  /*
  		��\
  		?��?-��B��?3?4
  			
  		?p
  			pid F?id
  			quantity p? 
  			delivertyDate ��'?
  		
  		?��
  			/&?��.		
  		*/
       case 1:  // sellerSystem/SystemB/requestPurchase
       {
         String pid = in.read_string ();
         int quantity = in.read_long ();
         cn.edu.nju.software.sellerSystem.Date deliveryDate = cn.edu.nju.software.sellerSystem.DateHelper.read (in);
         cn.edu.nju.software.sellerSystem.PurchaseResponse $result = null;
         $result = this.requestPurchase (pid, quantity, deliveryDate);
         out = $rh.createReply();
         cn.edu.nju.software.sellerSystem.PurchaseResponseHelper.write (out, $result);
         break;
       }


  /*
  		��\
  		n��?-,��?5?6
  			
  		?p
  			?U��
  		
  		?��
  			?-U�� ?-��\?-??\B?��		
  		*/
       case 2:  // sellerSystem/SystemB/ackPurchase
       {
         String orderno = in.read_string ();
         cn.edu.nju.software.sellerSystem.OrderBill $result = null;
         $result = this.ackPurchase (orderno);
         out = $rh.createReply();
         cn.edu.nju.software.sellerSystem.OrderBillHelper.write (out, $result);
         break;
       }


  /*
  		��\
  		?B?'��?9
  			
  		?p
  			?-��
  		
  		?��
  			��		
  		*/
       case 3:  // sellerSystem/SystemB/askToDeliver
       {
         String purchaseNo = in.read_string ();
         this.askToDeliver (purchaseNo);
         out = $rh.createReply();
         break;
       }


  /*
  		��\
  		?��?��?14
  			
  		?p
  			?-��
  		
  		?��
  			��		
  		*/
       case 4:  // sellerSystem/SystemB/notifyDealDone
       {
         String purchaseNo = in.read_string ();
         this.notifyDealDone (purchaseNo);
         out = $rh.createReply();
         break;
       }


  /*
  		��\
  		??n����?16
  			
  		?p
  			?-��
  		
  		?��
  			/&��??':?'G:??	?'		
  		*/
       case 5:  // sellerSystem/SystemB/affirm
       {
         String purchaseNo = in.read_string ();
         boolean $result = false;
         $result = this.affirm (purchaseNo);
         out = $rh.createReply();
         out.write_boolean ($result);
         break;
       }

       default:
         throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }

    return out;
  } // _invoke

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:sellerSystem/SystemB:1.0"};

  public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
  {
    return (String[])__ids.clone ();
  }

  public SystemB _this() 
  {
    return SystemBHelper.narrow(
    super._this_object());
  }

  public SystemB _this(org.omg.CORBA.ORB orb) 
  {
    return SystemBHelper.narrow(
    super._this_object(orb));
  }


} // class SystemBPOA
